<template>
	<view>
		<p class="photo"><image src="../../static/center/success2.png" class="img" /></p>
		<p class="success">恭喜您支付成功</p>
		<br />

		<view style="text-align:center;width:100%;font-size:14px;">
			<span id="wait_sec" style="color:green;font-size:20px;">{{miao}}</span>秒后将自动跳转到个人中心
		</view>
		<br />
		<br />

		<view style="width:100%;height: 60px;  border-top: 0px #E3E3E3 solid;text-align: center;display: flex;justify-content:center">
			<input type="button" value="首 页" disabled class="fk_button" style="border-radius: 6rpx;padding: 9rpx 0 9rpx 0;background: #ff7900;width:120px; color: #FFFFFF;font-size: 15px;" @click="goIndex()"/>
			<input type="button" value="个人中心" disabled class="fk_button" style="border-radius: 6rpx;padding: 9rpx 0 9rpx 0;margin-left: 20rpx;background: #ff7900;width:120px;color: #FFFFFF;font-size:15px;" @click="goHome()"/>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				miao:3 //秒数
			}
		},
		onLoad() {
			this.dumiao();
		},
		methods: {
			goIndex(){
				//跳转首页
				console.log("跳转到首页")
				uni.$emit('getJifenCenter');
				uni.navigateTo({
					url:'../index'
				})
			},
			goHome(){
				//跳转个人中心
				console.log("跳转个人中心")
				uni.$emit('getJifenCenter');
				uni.navigateTo({
					url:'../center/center'
				})
			},
			dumiao(){
				setTimeout(() => {
					if(this.miao==0){
						console.log("跳转个人中心页面")
						uni.$emit('getJifenCenter');
						uni.navigateTo({
							url:'../center/center'
						})
					}else{
						this.miao--
						this.dumiao()
					}
				},1000)
			}
		}
	}
</script>

<style>
	.img{
		width: 130rpx;
		height: 130rpx;
	}
	
	.photo {
		text-align: center;
		margin-top: 40%;
		margin-bottom: 2%;
	}
	
	.success {
		text-align: center;
		font-family: "黑体";
		color: black;
		font-size: 18px;
		letter-spacing: 3px;
	}
</style>
